using System.Security;
using System.Security.Permissions;
namespace Net35.Xrm.Sdk.Client
{
	[SecuritySafeCritical]
	[SecurityPermission(SecurityAction.Demand, Unrestricted = true)]
	public sealed class OrgIdentityProviderTrustConfiguration : IdentityProviderTrustConfiguration
	{
		public override System.Uri Endpoint
		{
			get
			{
				string policyValue = PolicyHelper.GetPolicyValue(base.XrmPolicy, "OrgIdEndpoint", null);
				if (!StringExtensions.IsNullOrWhiteSpace(policyValue))
				{
					return new System.Uri(policyValue);
				}
				return null;
			}
		}
		public System.Uri Identifier
		{
			get
			{
				string policyValue = PolicyHelper.GetPolicyValue(base.XrmPolicy, "OrgIdIdentifier", null);
				if (!StringExtensions.IsNullOrWhiteSpace(policyValue))
				{
					return new System.Uri(policyValue);
				}
				return null;
			}
		}
		public string LivePartnerIdentifier
		{
			get
			{
				return PolicyHelper.GetPolicyValue(base.XrmPolicy, "LivePartnerIdentifier", null);
			}
		}
		internal OrgIdentityProviderTrustConfiguration(AuthenticationPolicy xrmPolicy) : base(xrmPolicy)
		{
			base.AppliesTo = PolicyHelper.GetPolicyValue(base.XrmPolicy, "OrgIdAppliesTo", "");
			base.Policy = PolicyHelper.GetPolicyValue(base.XrmPolicy, "OrgIdPolicy", LiveIdAuthenticationConfiguration.DefaultPolicy);
			base.LiveIdAppliesTo = PolicyHelper.GetPolicyValue(base.XrmPolicy, "OrgIdDeviceAppliesTo", "http://Passport.NET/tb");
		}
	}
}
